package com.example.word.demo;

import com.example.word.service.impl.TemplateServiceImpl;
import org.apache.commons.pool2.BasePooledObjectFactory;
import org.apache.commons.pool2.PooledObject;
import org.apache.commons.pool2.impl.DefaultPooledObject;
import org.springframework.stereotype.Component;

/**
 * @author yuwen
 * @date 2023/5/16
 */
@Component
class FileValidatorFactory extends BasePooledObjectFactory<TemplateServiceImpl> {
    @Override
    public TemplateServiceImpl create() throws Exception {
        return new TemplateServiceImpl();
    }
    @Override
    public PooledObject<TemplateServiceImpl> wrap(TemplateServiceImpl validator) {
        return new DefaultPooledObject<>(validator);
    }
}